package cn.edu.jxau.controller.aop;

import cn.edu.jxau.core.annotation.Controller;
import cn.edu.jxau.core.annotation.Aspect;
import cn.edu.jxau.core.aop.AspectTemplate;

import java.lang.reflect.Method;

/**
 * Desc:
 * ------------------------------------
 * Author:fulei04@meituan.com
 * Date:2017/12/20
 * Time:下午4:34
 */
@Aspect(Controller.class)
public class ControllerAspect extends AspectTemplate {

    @Override
    public void begin() {
        System.out.println("--- begin");
    }

    @Override
    public void end() {
        System.out.println("--- end");
    }

    @Override
    public void before(Class targetClass, Method targetMethod, Object[] methodParams) {
        System.out.println("--- before");
    }

    @Override
    public void after(Class targetClass, Method targetMethod, Object[] methodParams) {
        System.out.println("--- after");
    }

    @Override
    protected void throwEx(Class targetClass, Method targetMethod, Object[] methodParams, Throwable throwable) {
        System.out.println("--- throw ex");
    }
}
